/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ejercicio.practica3;

import java.util.Random;

/**
 *
 * @author manolo
 */
public class EscalaVector {

    /**
     * Tamaño del vector
     */
    private int n;
   
    /**
     * Vector de enteros
     */
    private int[] vector;

   public EscalaVector(int n) {
        this.n = n;      
        vector = new int[n];
        Random rm = new Random();
        for (int i = 0; i < n; ++i) {
            this.vector[i] = rm.nextInt(5);
        }
    }

    public int getN() {
        return n;
    }

    public void setN(int n) {
        this.n = n;
    }

    public int[] getVector() {
        return vector;
    }

    public void setVector(int[] vector) {
        this.vector = vector;
    }

    public int getVector(int index) {
        return this.vector[index];
    }

    public void setVector(int index, int m) {
        this.vector[index] = m;
    }


    public void escala(int k)
    {
        for(int i=0; i < this.getN(); i++){
             this.vector[i] *= k ;
        }
    }
}
